#ifndef _QUEUE_H__
#define _QUEUE_H__
#include "config.h"

#define OVER_WRITE      1

typedef enum
{
    QUEUE_FAIL,
    QUEUE_OK
}err_code_t;

typedef struct
{
    uint16_t Read;
    uint16_t Write;
    uint16_t Size;
    uint8_t *Source;
}RingBuffer_t;

void Queue_Init(RingBuffer_t *handle, uint8_t *buf, uint16_t size);
err_code_t Queue_Push(RingBuffer_t *handle, uint8_t byte);
err_code_t Queue_Pop(RingBuffer_t *handle, uint8_t *byte);
uint16_t Queue_PopAll(RingBuffer_t *handle, uint8_t *buf);
err_code_t QueueIsEmpty(RingBuffer_t *handle);



#endif /* _QUEUE_H__ */
